package com.amazon.trietree.zkStub;

import com.netflix.curator.framework.CuratorFramework;
import com.netflix.curator.framework.CuratorFrameworkFactory;
import com.netflix.curator.retry.RetryNTimes;

/**
 * Created with IntelliJ IDEA.
 * User: Tylaar
 * Date: 11/9/12
 * Time: 10:55 AM
 * Company: Amazon.com
 */
public class CuratorClientFactory {

    public static CuratorFramework createCuratorClientFactory(String zkAddress, String namespace, int timeout, int retrytimes, int retryMargin)throws Exception{
        CuratorFramework client = CuratorFrameworkFactory.builder().connectString(zkAddress).
                namespace(namespace).retryPolicy(new RetryNTimes(retrytimes, retryMargin)).connectionTimeoutMs(timeout).build();
        return client;
    }
}
